<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <div id="app">
  
    <home></home>
  </div>
  <script src="./vue.js"></script>
  <script>
    const Child = {
      template:`
        <div>
          <h3>我是子组件头</h3>  
          <slot name="a"/>
          <h3>我是子组件尾</h3>  
          <slot name="b"/>
        </div>
      `
    }
    const Home = {
      template:`
        <div>
          <h2>我是home页</h2> 
          <child>
            <button slot="b">按钮</button>
            <hr/>
            <ul slot="a">
              <li v-for="el in arr" :key="el">
                {{ el }}  
              </li>  
            </ul>
          </child> 
        </div>
      `,
      data(){
        return {
          arr: ['秃驴','毛猴','懒猪','河妖']
        }
      },
      components: {
        Child
      }
    }
    
    {
      aaa,
      act(){}
    }
    Vue.component('Home',Home)
    const vm = new Vue({
      el:"#app"
    })
  </script>
</body>
</html>
